<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script type="text/javascript" src="CommonUtil/CommonUtil.js"></script>
    <script type="text/javascript" charset="utf-8">
        //装饰者用在函数上
        function getDate() {
            return (new Date().toString());
        }
        //包装函数
        function upperCaseDecorator(fn) {
            return function () {
                return fn.apply(this,arguments).toUpperCase();
            }
        };
        alert(getDate());
        var getUpperCaseDate =  upperCaseDecorator(getDate);
        alert(getUpperCaseDate());
    </script>
</head>
<body>
</body>
</html>